package com.example.mapper;

import com.example.Dto.DrugDto;
import com.example.aspect.vo.DrugVo;
import com.example.entity.Drug;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DrugMapper {

    /**
     * 动态查询药品，根据药品编号，或采购员编号或者都有都没有
     * @param drugDto
     * @return
     */
    List<Drug> scanDrugDetail_h2_16(DrugDto drugDto);

    /**
     * 根据药品编号删除药品
     * @param drugidH216
     */
    @Delete("delete from drug_h2_16 where drugid_h2_16=#{drugidH216}")
    void deleteByDrugid_h2_16(String drugidH216);

    /**
     * 插入药品记录
     * @param drugVo
     */
    @Insert("insert into drug_h2_16 (drugid_h2_16, drugname, price, quantity, deadline, empid_h2_16) " +
            "values (#{drugidH216},#{drugname},#{price},#{quantity},#{deadline},#{empidH216})")
    void insertDrugDetails_h2_16(DrugVo drugVo);
}
